import { createStore, applyMiddleware, combineReducers } from "redux";
import thunk from "redux-thunk"
import {composeWithDevTools} from "redux-devtools-extension"

import countReducer from "./reducer/count"
import personReducer from "./reducer/person"
import cartReducer from "./reducer/cart";

const allReducer = combineReducers({
    person:personReducer,
    count:countReducer,
    cart:cartReducer
})

// 生成store 全局只能有一个 用来保存数据
const store = createStore(allReducer,composeWithDevTools(applyMiddleware(thunk)))

export default store